package com.aqielife.demo.example.lambda;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;

public class VarDemo {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();  // list 变量1
        // String list = "aaa";        // final
        Consumer<String> consumer = s -> System.out.println(s + list); // list变量2 都指向同一个对象
        consumer.accept("1211");
    }
}
